package org.learnaholic.application.ui;

import java.awt.Color;
import java.util.HashMap;
import java.util.Map;

import org.learnaholic.application.model.Knowledge;

public class CellColorFactory
{
	private final static Map<Knowledge, Color> selectedBackgrounds		= new HashMap<Knowledge, Color>();
//	private final static Map<Knowledge, Color> selectedForegrounds		= new HashMap<Knowledge, Color>();
	private final static Map<Knowledge, Color> unselectedBackgrounds	= new HashMap<Knowledge, Color>();
//	private final static Map<Knowledge, Color> unselectedForegrounds	= new HashMap<Knowledge, Color>();
	private final static  Color unselectedForeground	= new Color(0x000055);
	private final static Color selectedForeground		= new Color(0xffffff);
	
	static
	{
		selectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_0, new Color(0x004400));
		unselectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_0, new Color(0x008000));
		selectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_1, new Color(0x114411));
		unselectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_1, new Color(0x228822));
		selectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_2, new Color(0x225522));
		unselectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_2, new Color(0x55BB55));
		selectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_3, new Color(0x448844));
		unselectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_3, new Color(0x99FF99));
		selectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_4, new Color(0x558855));
		unselectedBackgrounds.put(Knowledge.KNOWN_FORGOTTEN_LEVEL_4, new Color(0xBBFFBB));
		selectedBackgrounds.put(Knowledge.PARTIALLY_KNOWN, new Color(0x000088));
		unselectedBackgrounds.put(Knowledge.PARTIALLY_KNOWN, new Color(0x0000FF));
		selectedBackgrounds.put(Knowledge.TOTALLY_UNKNOWN, new Color(0x880000));
		unselectedBackgrounds.put(Knowledge.TOTALLY_UNKNOWN, new Color(0xEE0000));
		selectedBackgrounds.put(Knowledge.UNTESTED, new Color(0x666666));
		unselectedBackgrounds.put(Knowledge.UNTESTED, new Color(0xFFFFFF));
	}

	public static Color getSelectedBackground(Knowledge knowledge)
	{
		return selectedBackgrounds.get(knowledge);
	}
	public static Color getUnselectedBackground(Knowledge knowledge)
	{
		return unselectedBackgrounds.get(knowledge);
	}
	public static Color getSelectedForeground(Knowledge knowledge)
	{
		return selectedForeground;
	}
	public static Color getUnselectedForeground(Knowledge knowledge)
	{
		return unselectedForeground;
	}
}
